#ifndef STRUCTS_H
#define STRUCTS_H

namespace UDock {

#define uAbs(x) ((x)>0?(x):(-(x)))

struct Point {
    Point(){}
    Point(int x, int y){
        this->x = x;
        this->y = y;
    }
    void operator -=(const Point & other){
        this->x -= other.x;
        this->y -= other.y;
    }
    int manHattanDistance(const Point& other){
        return uAbs(x - other.x)+uAbs(y - other.y);
    }

    int x;
    int y;
};

struct Size {
    Size(int width,int height){
        this->height = height;
        this->width = width;
    }

    int width;
    int height;
};

struct Rect {
    Rect(int x, int y, int width, int height)
        :point(x,y),size(width, height){}
    Point point;
    Size size;
};

}

#endif // STRUCTS_H
